<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE Safe #-}</span><span>
</span><span id="line-2"></span><span>
</span><span id="line-3"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-4"></span><span class="hs-comment">-- |</span><span>
</span><span id="line-5"></span><span class="hs-comment">-- Module      :  System.Mem.StableName</span><span>
</span><span id="line-6"></span><span class="hs-comment">-- Copyright   :  (c) The University of Glasgow 2001</span><span>
</span><span id="line-7"></span><span class="hs-comment">-- License     :  BSD-style (see the file libraries/base/LICENSE)</span><span>
</span><span id="line-8"></span><span class="hs-comment">--</span><span>
</span><span id="line-9"></span><span class="hs-comment">-- Maintainer  :  libraries@haskell.org</span><span>
</span><span id="line-10"></span><span class="hs-comment">-- Stability   :  experimental</span><span>
</span><span id="line-11"></span><span class="hs-comment">-- Portability :  non-portable</span><span>
</span><span id="line-12"></span><span class="hs-comment">--</span><span>
</span><span id="line-13"></span><span class="hs-comment">-- Stable names are a way of performing fast ( \(\mathcal{O}(1)\) ),</span><span>
</span><span id="line-14"></span><span class="hs-comment">-- not-quite-exact comparison between objects.</span><span>
</span><span id="line-15"></span><span class="hs-comment">--</span><span>
</span><span id="line-16"></span><span class="hs-comment">-- Stable names solve the following problem: suppose you want to build</span><span>
</span><span id="line-17"></span><span class="hs-comment">-- a hash table with Haskell objects as keys, but you want to use</span><span>
</span><span id="line-18"></span><span class="hs-comment">-- pointer equality for comparison; maybe because the keys are large</span><span>
</span><span id="line-19"></span><span class="hs-comment">-- and hashing would be slow, or perhaps because the keys are infinite</span><span>
</span><span id="line-20"></span><span class="hs-comment">-- in size.  We can\'t build a hash table using the address of the</span><span>
</span><span id="line-21"></span><span class="hs-comment">-- object as the key, because objects get moved around by the garbage</span><span>
</span><span id="line-22"></span><span class="hs-comment">-- collector, meaning a re-hash would be necessary after every garbage</span><span>
</span><span id="line-23"></span><span class="hs-comment">-- collection.</span><span>
</span><span id="line-24"></span><span class="hs-comment">--</span><span>
</span><span id="line-25"></span><span class="hs-comment">-------------------------------------------------------------------------------</span><span>
</span><span id="line-26"></span><span>
</span><span id="line-27"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">System.Mem.StableName</span><span> </span><span class="hs-special">(</span><span>
</span><span id="line-28"></span><span>  </span><span class="annot"><span class="hs-comment">-- * Stable Names</span></span><span>
</span><span id="line-29"></span><span>  </span><span class="annot"><a href="GHC.StableName.html#StableName"><span class="hs-identifier">StableName</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-30"></span><span>  </span><span class="annot"><a href="GHC.StableName.html#makeStableName"><span class="hs-identifier">makeStableName</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-31"></span><span>  </span><span class="annot"><a href="GHC.StableName.html#hashStableName"><span class="hs-identifier">hashStableName</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-32"></span><span>  </span><span class="annot"><a href="GHC.StableName.html#eqStableName"><span class="hs-identifier">eqStableName</span></a></span><span>
</span><span id="line-33"></span><span>  </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-34"></span><span>
</span><span id="line-35"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.StableName.html"><span class="hs-identifier">GHC.StableName</span></a></span><span>
</span><span id="line-36"></span></pre></body></html>